<template>
	<view class="contina bBtn_p_b140">
		<view style="height: calc(100% - 132rpx);">
			<view class="card">
				<view class="cont">
					<view class="flex_a_c par">
						<view class="label">公司名称</view>
						<view class="value">{{corp_name}}</view>
					</view>
					<view class="flex_a_c par">
						<view class="label">授权人姓名</view>
						<view class="value">
							<u--input v-model="form.name" placeholder-style="text-align: right;color:#999999"
								placeholder="请输入授权人姓名" border="none" inputAlign="right">
							</u--input>
						</view>
					</view>
					<view class="flex_a_c par">
						<view class="label">授权手机号</view>
						<view class="value">
							<u--input v-model="form.phone" placeholder-style="text-align: right;color:#999999"
								placeholder="请输入授权手机号" border="none" inputAlign="right">
							</u--input>
						</view>
					</view>
				</view>
			</view>
		</view>
		<flooterCom text="提交" @click="submit()"></flooterCom>
	</view>
</template>

<script>
	import flooterCom from "@/compoment/flooterCom.vue"
	export default {
		data() {
			return {
				labelStyle: {
					display: 'flex',
					justifyContent: 'spaceBetween'
				},
				corp_name: '',
				form: {
					corp_id: 0,
					name: '',
					phone: '',
				},
			}
		},
		components: {
			flooterCom
		},
		onLoad(option) {
			this.form.corp_id = option.id
			this.$api.corpApi.detail({
				id: option.id
			}).then((res) => {
				this.corp_name = res.name
			})
		},
		methods: {
			async submit() {
				uni.showLoading({
					title: '保存中...',
					mask: true
				})
				try {
					await this.$api.corpPermissionApi.add(this.form)

					uni.navigateTo({
						url: "/pagesB/authSuccess/authSuccess?id="+this.form.corp_id
					})
					uni.hideLoading()

				} catch (e) {
					uni.hideLoading()
				}
			},
		}
	}
</script>

<style lang="scss" scoped>
	.contina {
		height: 100%;

		.seach {
			padding: 20rpx 30rpx;
			background-color: #fff;
			// margin-bottom: 20rpx;
			box-sizing: border-box;

			.tabs {
				justify-content: space-between;
				align-items: center;
				font-size: 26rpx;
				font-weight: 400;
				color: #3D3D3D;
				margin-top: 30rpx;
			}
		}

		.card {
			padding: 30rpx;
			box-sizing: border-box;
			position: relative;
			margin-top: 20rpx;

			.cont {
				.par {
					margin: 30rpx 0;
					justify-content: space-between;
					padding-bottom: 30rpx;
					border-bottom: 1px solid #EEEEEE;
				}

				.par:last-child {
					padding-bottom: 0;
					border-bottom: none;
					margin-bottom: 0;
				}

				.label {
					font-size: 28rpx;
					font-weight: 400;
					color: #999999;
					margin-right: 20rpx;
				}

				.value {
					font-size: 28rpx;
					font-weight: 400;
					color: #000000;
				}
			}
		}

		image {
			width: 412rpx;
			height: 284rpx;
			border-radius: 0px 0px 0px 0px;
		}

		.no {
			margin-top: 50rpx;
			display: flex;
			justify-content: center;
			flex-direction: column;
			align-items: center;
			margin-top: 332rpx;

			.em {
				width: 128rpx;
				height: 50rpx;
				font-size: 32rpx;
				font-family: PingFang SC, PingFang SC;
				font-weight: 400;
				color: #888888;
			}
		}


	}
</style>